import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            int n = in.nextInt();
            if (n == 0) {
                break;
            } else {
                System.out.println((int) (Math.pow(5, n) - 4) + " " + (long) (Math.pow(4, n) + n - 4));
            }
        }
    }
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = in.nextInt();
        }
        int l = in.nextInt()-1;
        int r = in.nextInt()-1;

        for (int i = 0; i < l; i++) {
            System.out.print(arr[i] + " ");
        }
        for (int i = r; i >= l; i--) {
            System.out.print(arr[i] + " ");
        }
        for (int i = r+1; i < arr.length; i++) {
            System.out.print(arr[i] + " ");
        }
    }
}
